<h1>
    <? if(!$this->post): ?>
    <?= $this->partial('user/navigation4user.phtml')?>
    <? endif ?>
    <? $style = !($this->post) ? 'style="display: none;"' : null ?>
    <div id="form-charge" <?= $style ?>>
        <?= $this->form ?>
    </div><br>
</h1>
<?
$user = $this->user;
?>

<? if (empty($user['avatar'])): ?>
<h1>No avatar.</h1>
<? else: ?>
<a href="<?= $user['avatar'] ?>" target="_blank">
    <img src="<?= $user['avatar'] ?>" class="avatar" alt="<?= $user['nick'] ?>"/>
</a>
<? endif; ?>

<form action="/user/avatar" method="post" enctype="multipart/form-data">
    <input type="file" name="avatar"/>
    <input type="submit" value="Update"/>
</form>

